package com.zheng.activiti.rpc.service.impl;

import com.zheng.activiti.rpc.api.ActSaveReturnService;
import org.activiti.engine.IdentityService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.TaskService;
import org.activiti.engine.identity.Group;
import org.activiti.engine.identity.User;
import org.activiti.engine.repository.Model;
import org.activiti.engine.task.Attachment;
import org.activiti.engine.task.Task;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Created by likun on 2018/3/28.
 */
public class ActSaveReturnServiceImpl implements ActSaveReturnService {

    @Autowired
    RepositoryService repositoryService;
    @Autowired
    IdentityService identityService;
    @Autowired
    TaskService taskService;

    @Override
    public Model saveModel(Model model) {
        repositoryService.saveModel(model);
        return model;
    }

    @Override
    public Group saveGroup(Group group) {
        identityService.saveGroup(group);
        return group;
    }

    @Override
    public User saveUser(User user) {
        identityService.saveUser(user);
        return user;
    }

    @Override
    public Task saveTask(Task task) {
        taskService.saveTask(task);
        return task;
    }

    @Override
    public Attachment saveAttachment(Attachment attachment) {
        taskService.saveAttachment(attachment);
        return attachment;
    }
}
